﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BruteForce.Characters;

namespace BruteForce.Screens.CreateNewCharacterScreen
{
    class CharacterCreationLogic
    {
        public static Resources GetNeededResources(CharacterType characterType,Resources resources)
        {
            Resources ans = null;
            switch (characterType)
            {
                    case CharacterType.Defender:
                        ans = GetNeededForLifeDefender(resources.Life);
                        ans.AddResources(GetNeededForSpeedDefender(resources.Speed));
                        break;
                    case CharacterType.Bomber:
                        ans = GetNeededForLifeBomber(resources.Life);
                        ans.AddResources(GetNeededForPowerBomber(resources.Power));
                        ans.AddResources(GetNeededForSpeedBomber(resources.Speed));
                        ans.AddResources(GetNeededForlightBomber(resources.Light));
                        break;
                    case CharacterType.Archer:

                        ans = GetNeededForLifeArcher(resources.Life);
                        ans.AddResources(GetNeededForPowerArcher(resources.Power));
                        ans.AddResources(GetNeededForSpeedArcher(resources.Speed));
                        ans.AddResources(GetNeededForlightArcher(resources.Light));
                    break;
            }
            return ans;
        }

        //Bomber

        public static Resources GetNeededForLifeBomber(int life)
        {
            return new Resources(0, 0, 5 * life, 0);
        }

        public static Resources GetNeededForlightBomber(int Light)
        {
            return new Resources(3*Light, 10 *Light, 0, 0);
        }

        public static Resources GetNeededForPowerBomber(int Power)
        {
            return new Resources(0, 5 * Power, 0, 0);
        }

        public static Resources GetNeededForSpeedBomber(int speed)
        {
            return new Resources(0, 0, 3*speed, speed);
        }
        //Archer


        public static Resources GetNeededForLifeArcher(int life)
        {
            return new Resources(0, 0, 5 * life, 0);
        }

        public static Resources GetNeededForlightArcher(int Light)
        {
            return new Resources(3 * Light, 10 * Light, 0, 0);
        }

        public static Resources GetNeededForPowerArcher(int Power)
        {
            return new Resources(0, 5 * Power, 0, 0);
        }

        public static Resources GetNeededForSpeedArcher(int speed)
        {
            return new Resources(0, 0, 3 * speed, speed);
        }
        //Defender

        public static Resources GetNeededForSpeedDefender(int speed)
        {
            return new Resources(0, 0, 0, 5*speed);
        }

        public static Resources GetNeededForLifeDefender(int life)
        {
            return new Resources(0, 2 * life, life,0);
        }


    }
}
